package com.servlet.vo.bean;

import java.math.BigDecimal;

import com.servlet.vo.IdEntity;
/**
 * TradeLog.java 
 * 交易记录
 * @date 2016-12-03
 * @author bao
 *
 */
public class TradeLog extends IdEntity {

	/** 涉及载体 */
	private long carrier;
	/** 涉及载体名称 */
	private String carrierName;
	/** 变动账户 */
	private long acc;
	/** 变动账户名称 */
	private String accName;
	/** 交易描述 */
	private String trade_desp;
	/** 交易类型：1_收入 ；0_支出  ；-1_冲账 */
	private int trade_type;
	/** 冲正交易id */
	private Long correct_trade;
	/** 金额 */
	private BigDecimal amount = BigDecimal.ZERO;
	/** 交易后载体最新余额 */
	private BigDecimal carrierAvailableBalance = BigDecimal.ZERO;
	/** 交易后账户最新余额 */
	private BigDecimal accountAvailableBalance = BigDecimal.ZERO;
	
	/***** GET && SET ***********/

	public String getCarrierName() {
		return carrierName;
	}
	public void setCarrierName(String carrierName) {
		this.carrierName = carrierName;
	}
	public String getAccName() {
		return accName;
	}
	public void setAccName(String accName) {
		this.accName = accName;
	}
	public BigDecimal getCarrierAvailableBalance() {
		return carrierAvailableBalance;
	}
	public void setCarrierAvailableBalance(BigDecimal carrierAvailableBalance) {
		this.carrierAvailableBalance = carrierAvailableBalance;
	}
	public BigDecimal getAccountAvailableBalance() {
		return accountAvailableBalance;
	}
	public void setAccountAvailableBalance(BigDecimal accountAvailableBalance) {
		this.accountAvailableBalance = accountAvailableBalance;
	}
	public String getTrade_desp() {
		return trade_desp;
	}
	public void setTrade_desp(String tradeDesp) {
		trade_desp = tradeDesp;
	}
	public String getTrade_typeVal(){
		String result = null;
		switch(trade_type){
			case -1 :result = "冲正"; break;
			case  0 :result = "支出"; break;
			case  1 :result = "收入"; break;
		}
		return result;
	}
	public int getTrade_type() {
		return trade_type;
	}
	public void setTrade_type(int tradeType) {
		trade_type = tradeType;
	}
	public Long getCorrect_trade() {
		return correct_trade;
	}
	public void setCorrect_trade(Long correctTradeId) {
		correct_trade = correctTradeId;
	}
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	public long getCarrier() {
		return carrier;
	}
	public void setCarrier(long carrierId) {
		carrier = carrierId;
	}
	public long getAcc() {
		return acc;
	}
	public void setAcc(long accId) {
		acc = accId;
	}
}
